﻿using System;
using System.Data;
using System.Linq;
using System.Text;
using System.Collections.Generic;

using Cratos.Tools.General;
using Cratos.Tools.DataObject;

namespace Cratos.Generator.DataObject
{
	/// <summary>
	/// Cratos Module Data Object class
	/// </summary>
	[Serializable]
	[DOCratos("Cratos Module")]
	[DOCratosAction(DOCratosAction.Retrieve, DOCratosActionType.StoredProcedure, true, "spCratosModule_Retrieve")]
	[DOCratosAction(DOCratosAction.Create, DOCratosActionType.StoredProcedure, true, "spCratosModule_Create")]
	[DOCratosAction(DOCratosAction.Update, DOCratosActionType.StoredProcedure, false, "spCratosModule_Update")]
	[DOCratosAction(DOCratosAction.Delete, DOCratosActionType.StoredProcedure, false, "spCratosModule_Delete")]
	public class DOCratosModule : DOCratos, IDOCratos
	{
		#region Class Constant declarations
		/// <summary>
		/// Module Column
		/// </summary>
		public const string DBIdColumn = "CratosModule_ID";

		/// <summary>
		/// Cratos Project ID Column
		/// </summary>
		public const string DBCratosProjectId = "CratosProject_ID";

		/// <summary>
		/// Module Column
		/// </summary>
		public const string DBNameColumn = "CratosModule_Name";

		/// <summary>
		/// Module Column
		/// </summary>
		public const string DBIsActiveColumn = "CratosModule_IsActive";
		#endregion

		#region Class Event declarations
		#endregion

		#region Class Variable declarations
		#region DO Variables
		private long			 m_ID;
		private long			 m_CratosProjectId;
		private string		 m_Name;
		private bool			 m_IsActive;
		#endregion

		#region Embedded Object Variables
		#endregion
		#endregion

		#region Class Constructors & Destructors
		/// <summary>
		/// Class Constructor
		/// </summary>
		public DOCratosModule() : base()
		{
			// Set the relevant CRUD Action indicators
			this.CanCreate		= true;
			this.CanRetrieve	= true;
			this.CanUpdate		= true;
			this.CanDelete		= true;
		}
		#endregion

		#region Class Properties
		#region DO Properties
		/// <summary>
		/// ID
		/// </summary>
		[DOCratosColumn("Id", "Id", DbType.Int64, DOCratosModule.DBIdColumn, 0, IsKey = true)]
		[DOCratosActionColumn(DOCratosAction.Retrieve, true)]
		[DOCratosActionColumn(DOCratosAction.Update, true)]
		[DOCratosActionColumn(DOCratosAction.Delete, true)]
		public long Id
		{
			get { return(this.m_ID); }
			set { this.m_ID = value; this.NotifyPropertyChanged("ID"); }
		}

		/// <summary>
		/// Cratos Project ID
		/// </summary>
		[DOCratosColumn("CratosProjectId", "CratosProjectId", DbType.Int64, DOCratosModule.DBCratosProjectId, 0)]
		[DOCratosActionColumn(DOCratosAction.Create, true)]
		public long CratosProjectId
		{
			get { return (this.m_CratosProjectId); }
			set { this.m_CratosProjectId = value; this.NotifyPropertyChanged("CratosProjectId"); }
		}

		/// <summary>
		/// Name
		/// </summary>
		[DOCratosColumn("Name", "Name", DbType.String, DOCratosModule.DBNameColumn, "")]
		[DOCratosActionColumn(DOCratosAction.Create, true)]
		[DOCratosActionColumn(DOCratosAction.Update, true)]
		public string Name
		{
			get { return(this.m_Name); }
			set { this.m_Name = value; this.NotifyPropertyChanged("Name"); }
		}

		/// <summary>
		/// IsActive
		/// </summary>
		[DOCratosColumn("IsActive", "IsActive", DbType.Boolean, DOCratosModule.DBIsActiveColumn, true)]
		public bool IsActive
		{
			get { return(this.m_IsActive); }
			set { this.m_IsActive = value; this.NotifyPropertyChanged("IsActive"); }
		}
		#endregion

		#region Embbedded Object Properties
		#endregion
		#endregion

		#region Class Methods
		#endregion

		#region Class Support Methods
		#endregion
	}
}
